package exception;
/*
throws演示
 */
public class ThrowsDemo {
    public static void main(String[] args) {
        Student zs=new Student();
        try {
            zs.setName("刘德");
        } catch (IllegalAgeExceptiong illegalAgeExceptiong) {
            //illegalAgeExceptiong.printStackTrace();
            System.out.println(illegalAgeExceptiong.getMessage());//获取错误信息
        }
        System.out.println("名字错误");

    }
}
